home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / pluginy Firefox / 8542 / 8542.xpi / chrome / lastpass.jar / content / prefs.js < prev    next >
Text File  |  2010-02-14  |  37KB  |  105 lines

  1. var options=new Array();options[0]="General";options[1]="Feedback";options[2]="HotKeys";options[3]="AccountSettings";options[4]="Advanced";options[5]="Notifications";options[6]="Icons";var optionsData=new Array();var bMustRestart=false;var HIDE_FEEDBACK=0;var HIDE_ACCOUNTSETTINGS=0;var HIDE_SHOWHOMEPAGEAFTERLOGON=0;
  2. var HIDE_APPEARANCE_BOX=0;var HIDE_COMPACT_OPTION=0;var HIDE_SIDEBAR_OPTION=0;var HIDE_CONTEXT_OPTION=0;var HIDE_GROUPS_OPTION=0;var HIDE_IDLELOGOFF=0;var HIDE_AUTOLOGOFFCLOSE=0;function window_load(){document.title=LP.lpgs("LastPass Control Panel");LP.sr(document,"GeneralPage","label","General");LP.sr(document,"NotificationsPage","label","Notifications");
  3. LP.sr(document,"FeedbackPage","label","Feedback");LP.sr(document,"HotKeysPage","label","HotKeys");LP.sr(document,"AccountSettingsPage","label","Account Settings");LP.sr(document,"AdvancedPage","label","Advanced");LP.sr(document,"IconsPage","label","Icons");document.documentElement.getButton("accept").setAttribute("label",LP.lpgs("OK"));
  4. document.documentElement.getButton("cancel").setAttribute("label",LP.lpgs("Cancel"));if(LP.lpdolostpwotp&&LP.getLoggedIn()&&!LP.lpprefsHasUserValue("StoreLostPWOTP")){if(LP.lpConfirmYesNo(LP.lpgs("ExistingUsersOTPPrompt"))){LP.lpprefsSetBoolPref("StoreLostPWOTP",true)}else{LP.lpprefsSetBoolPref("StoreLostPWOTP",false)
  5. }}if(LP.islastpass){document.getElementById("IconsPage").hidden=false}readAllPrefData();var A=window.arguments;var F=document.getElementById("lastpass-options-list");var C=options[0];if(A&&A.length>0&&typeof(A[0])!="undefined"){C=A[0]}var B=null;if(A&&A.length>1&&typeof(A[1])!="undefined"){B=A[1]}var D=document.getElementById(C+"Page");
  6. F.selectItem(D);if(C=="Feedback"&&B!=null){document.documentElement.getButton("accept").setAttribute("label",LP.lpgs("Send"));if(B==3){LP.lpshowHelpDlg("loginprob",window.opener)}var E=document.getElementById("lastpass-iframe");var G=E.contentDocument;G.getElementById("subject").value=G.getElementById("subject-popup").childNodes.item(B).getAttribute("label");
  7. change_subject(G,E.contentWindow)}LP.sr(document,"FeedbackPage","hidden",HIDE_FEEDBACK?true:false);LP.sr(document,"AccountSettingsPage","hidden",HIDE_ACCOUNTSETTINGS?true:false)}function readAllPrefData(){optionsData.General=new Array();optionsData.General["disableffpw"]=!LP.lpprefsGetBoolPref("signon.rememberSignons",false,LP.lpmainprefs);
  8. optionsData.General["pageOpenTab"]=LP.lpGetPageOpenSetting();optionsData.General["pageOpenSameTab"]=LP.lpGetPageOpenSetting("same");optionsData.General["highlightFields"]=LP.lpprefsHasUserValue("highlightFields")?LP.lpprefsGetBoolPref("highlightFields"):true;optionsData.General["showAcctsInGroups"]=LP.lpprefsHasUserValue("showAcctsInGroups")?LP.lpprefsGetBoolPref("showAcctsInGroups"):true;
  9. optionsData.General["showAcctsInSidebar"]=LP.lpprefsHasUserValue("showAcctsInSidebar")?LP.lpprefsGetBoolPref("showAcctsInSidebar"):false;optionsData.General["hidecontextmenu"]=LP.lpprefsHasUserValue("hidecontextmenu",false)?LP.lpprefsGetBoolPref("hidecontextmenu",false):false;optionsData.General["logOffWhenCloseBrowser"]=LP.lpprefsHasUserValue("logOffWhenCloseBrowser")?LP.lpprefsGetBoolPref("logOffWhenCloseBrowser"):false;
  10. optionsData.General["logOffWhenCloseBrowserVal"]=LP.lpprefsHasUserValue("logOffWhenCloseBrowserVal")?LP.lpprefsGetIntPref("logOffWhenCloseBrowserVal"):0;optionsData.General["idleLogoff"]=LP.lpprefsHasUserValue("idleLogoff")?LP.lpprefsGetBoolPref("idleLogoff"):false;optionsData.General["idleLogoffVal"]=LP.lpprefsHasUserValue("idleLogoffVal")?LP.lpprefsGetIntPref("idleLogoffVal"):15;
  11. optionsData.General["useCompact"]=LP.lpprefsHasUserValue("useCompact",false)?LP.lpprefsGetBoolPref("useCompact",false):true;optionsData.General["automaticallyFill"]=LP.lpprefsHasUserValue("automaticallyFill")?LP.lpprefsGetBoolPref("automaticallyFill"):true;optionsData.General["showHomepageAfterLogin"]=LP.lpprefsHasUserValue("showHomepageAfterLogin",false)?LP.lpprefsGetBoolPref("showHomepageAfterLogin",false):true;
  12. optionsData.Notifications=new Array();optionsData.Notifications["showNotifications"]=LP.lpprefsHasUserValue("showNotifications")?LP.lpprefsGetBoolPref("showNotifications"):true;optionsData.Notifications["showLoginNotifications"]=LP.lpprefsHasUserValue("showLoginNotifications",false)?LP.lpprefsGetBoolPref("showLoginNotifications",false):(LP.lpprefsHasUserValue("showLoginNotifications")?LP.lpprefsGetBoolPref("showLoginNotifications"):true);
  13. optionsData.Notifications["showFormFillNotifications"]=LP.lpprefsHasUserValue("showFormFillNotifications")?LP.lpprefsGetBoolPref("showFormFillNotifications"):true;optionsData.Notifications["showSaveSiteNotifications"]=LP.lpprefsHasUserValue("showSaveSiteNotifications")?LP.lpprefsGetBoolPref("showSaveSiteNotifications"):true;
  14. optionsData.Notifications["offerGeneratePasswd"]=LP.lpprefsHasUserValue("offerGeneratePasswd")?LP.lpprefsGetBoolPref("offerGeneratePasswd"):true;optionsData.Notifications["notificationsBottom"]=LP.lpprefsHasUserValue("notificationsBottom")?LP.lpprefsGetBoolPref("notificationsBottom"):false;optionsData.Notifications["notificationsAfterClick"]=LP.lpprefsHasUserValue("notificationsAfterClick")?LP.lpprefsGetBoolPref("notificationsAfterClick"):true;
  15. optionsData.HotKeys=new Array();optionsData.HotKeys["generateHkKeyCode"]=LP.lpprefsHasUserValue("generateHkKeyCode",false)?LP.lpprefsGetIntPref("generateHkKeyCode",false):0;optionsData.HotKeys["generateHkMods"]=LP.lpprefsHasUserValue("generateHkMods",false)?LP.lpprefsGetCharPref("generateHkMods",false):"";
  16. optionsData.HotKeys["recheckHkKeyCode"]=LP.lpprefsHasUserValue("recheckHkKeyCode",false)?LP.lpprefsGetIntPref("recheckHkKeyCode",false):0;optionsData.HotKeys["recheckHkMods"]=LP.lpprefsHasUserValue("recheckHkMods",false)?LP.lpprefsGetCharPref("recheckHkMods",false):"";optionsData.HotKeys["searchHkKeyCode"]=LP.lpprefsHasUserValue("searchHkKeyCode",false)?LP.lpprefsGetIntPref("searchHkKeyCode",false):0;
  17. optionsData.HotKeys["searchHkMods"]=LP.lpprefsHasUserValue("searchHkMods",false)?LP.lpprefsGetCharPref("searchHkMods",false):"";optionsData.HotKeys["nextHkKeyCode"]=LP.lpprefsHasUserValue("nextHkKeyCode",false)?LP.lpprefsGetIntPref("nextHkKeyCode",false):0;optionsData.HotKeys["nextHkMods"]=LP.lpprefsHasUserValue("nextHkMods",false)?LP.lpprefsGetCharPref("nextHkMods",false):"";
  18. optionsData.HotKeys["prevHkKeyCode"]=LP.lpprefsHasUserValue("prevHkKeyCode",false)?LP.lpprefsGetIntPref("prevHkKeyCode",false):0;optionsData.HotKeys["prevHkMods"]=LP.lpprefsHasUserValue("prevHkMods",false)?LP.lpprefsGetCharPref("prevHkMods",false):"";optionsData.HotKeys["submitHkKeyCode"]=LP.lpprefsHasUserValue("submitHkKeyCode",false)?LP.lpprefsGetIntPref("submitHkKeyCode",false):0;
  19. optionsData.HotKeys["submitHkMods"]=LP.lpprefsHasUserValue("submitHkMods",false)?LP.lpprefsGetCharPref("submitHkMods",false):"";optionsData.HotKeys["homeHkKeyCode"]=LP.lpprefsHasUserValue("homeHkKeyCode",false)?LP.lpprefsGetIntPref("homeHkKeyCode",false):0;optionsData.HotKeys["homeHkMods"]=LP.lpprefsHasUserValue("homeHkMods",false)?LP.lpprefsGetCharPref("homeHkMods",false):"";
  20. optionsData.HotKeys["saveallHkKeyCode"]=LP.lpprefsHasUserValue("saveallHkKeyCode",false)?LP.lpprefsGetIntPref("saveallHkKeyCode",false):0;optionsData.HotKeys["saveallHkMods"]=LP.lpprefsHasUserValue("saveallHkMods",false)?LP.lpprefsGetCharPref("saveallHkMods",false):"";optionsData.HotKeys["logoffHkKeyCode"]=LP.lpprefsHasUserValue("logoffHkKeyCode",false)?LP.lpprefsGetIntPref("logoffHkKeyCode",false):0;
  21. optionsData.HotKeys["logoffHkMods"]=LP.lpprefsHasUserValue("logoffHkMods",false)?LP.lpprefsGetCharPref("logoffHkMods",false):"";optionsData.Advanced=new Array();optionsData.Advanced["autoauto"]=LP.lpprefsHasUserValue("autoauto")?LP.lpprefsGetBoolPref("autoauto"):true;optionsData.Advanced["autoautoVal"]=LP.lpprefsHasUserValue("autoautoVal")?LP.lpprefsGetIntPref("autoautoVal"):25;
  22. optionsData.Advanced["warninsecureforms"]=LP.lpprefsHasUserValue("warninsecureforms")?LP.lpprefsGetBoolPref("warninsecureforms"):false;optionsData.Advanced["dontfillautocompleteoff"]=LP.lpprefsHasUserValue("dontfillautocompleteoff")?LP.lpprefsGetBoolPref("dontfillautocompleteoff"):false;optionsData.Advanced["pollServer"]=LP.lpprefsHasUserValue("pollServer")?LP.lpprefsGetBoolPref("pollServer"):true;
  23. optionsData.Advanced["pollServerVal"]=LP.lpprefsHasUserValue("pollServerVal")?LP.lpprefsGetIntPref("pollServerVal"):15;optionsData.Advanced["clearClipboard"]=LP.lpprefsHasUserValue("clearClipboard")?LP.lpprefsGetBoolPref("clearClipboard"):true;optionsData.Advanced["clearClipboardSecsVal"]=LP.get_clearClipboardSecsVal();
  24. optionsData.Advanced["openloginstart"]=LP.lpprefsHasUserValue("openloginstart")?LP.lpprefsGetBoolPref("openloginstart"):false;optionsData.Advanced["capturenewformfill"]=LP.lpprefsHasUserValue("capturenewformfill")?LP.lpprefsGetBoolPref("capturenewformfill"):true;optionsData.Advanced["StoreLostPWOTP"]=LP.lpprefsHasUserValue("StoreLostPWOTP")?LP.lpprefsGetBoolPref("StoreLostPWOTP"):true;
  25. optionsData.Advanced["language"]=LP.lpprefsHasUserValue("language",false)?LP.lpprefsGetCharPref("language",false):"";optionsData.Icons=new Array();optionsData.Icons["choice"]=LP.lpprefsHasUserValue("Icon",false)?LP.lpprefsGetIntPref("Icon",false):0}function writeAllPrefData(){var E=new Array("generate","recheck","search","next","prev","submit","home","saveall","logoff");
  26. var H=false;for(var G=0;G<E.length-1;G++){var M=optionsData.HotKeys[E[G]+"HkKeyCode"];if(M==0){continue}var D=optionsData.HotKeys[E[G]+"HkMods"];for(var F=G+1;F<E.length;F++){var L=optionsData.HotKeys[E[F]+"HkKeyCode"];if(L==0){continue}var C=optionsData.HotKeys[E[F]+"HkMods"];if(L==M&&C==D){H=true;break
  27. }}if(H){break}}if(H){LP.alert(LP.lpgs("You cannot assign more than one HotKey the same value."));return false}LP.lpmainprefs.setBoolPref("signon.rememberSignons",!optionsData.General["disableffpw"]);LP.lpprefsSetBoolPref("pageOpenTab",optionsData.General["pageOpenTab"]);LP.lpprefsSetBoolPref("pageOpenSameTab",optionsData.General["pageOpenSameTab"]);
  28. LP.lpprefsSetBoolPref("highlightFields",optionsData.General["highlightFields"]);LP.lpprefsSetBoolPref("showAcctsInGroups",optionsData.General["showAcctsInGroups"]);LP.lpprefsSetBoolPref("showAcctsInSidebar",optionsData.General["showAcctsInSidebar"]);LP.lpprefsSetBoolPref("hidecontextmenu",optionsData.General["hidecontextmenu"],false);
  29. var K=LP.lpprefsHasUserValue("logOffWhenCloseBrowser")?LP.lpprefsGetBoolPref("logOffWhenCloseBrowser"):false;var A=LP.lpprefsHasUserValue("logOffWhenCloseBrowserVal")?LP.lpprefsGetIntPref("logOffWhenCloseBrowserVal"):0;LP.lpprefsSetBoolPref("logOffWhenCloseBrowser",optionsData.General["logOffWhenCloseBrowser"]);
  30. LP.lpprefsSetIntPref("logOffWhenCloseBrowserVal",optionsData.General["logOffWhenCloseBrowserVal"]);LP.lpprefsSetBoolPref("idleLogoff",optionsData.General["idleLogoff"]);LP.lpprefsSetIntPref("idleLogoffVal",optionsData.General["idleLogoffVal"]);LP.lpPopulateAccounts(LP.lpacctsreq);var B=K&&A==0?true:false;
  31. var N=optionsData.General["logOffWhenCloseBrowser"]&&optionsData.General["logOffWhenCloseBrowserVal"]==0?true:false;if(B!=N){LP.lplogincheck("preferences")}var I=LP.lpprefsHasUserValue("useCompact",false)?LP.lpprefsGetBoolPref("useCompact",false):true;if(I!=optionsData.General["useCompact"]){LP.lpprefsSetBoolPref("useCompact",optionsData.General["useCompact"],false);
  32. LP.lpprefsSetBoolPref("toolbarinitdone",false,false);LP.lpUpdateAllToolbars(optionsData.General["useCompact"])}LP.lpprefsSetBoolPref("automaticallyFill",optionsData.General["automaticallyFill"]);LP.lpprefsSetBoolPref("showHomepageAfterLogin",optionsData.General["showHomepageAfterLogin"],false);LP.lpprefsSetBoolPref("showNotifications",optionsData.Notifications["showNotifications"]);
  33. LP.lpprefsSetBoolPref("showNotifications",optionsData.Notifications["showNotifications"],false);LP.lpprefsSetBoolPref("showLoginNotifications",optionsData.Notifications["showLoginNotifications"],false);LP.lpprefsSetBoolPref("offerGeneratePasswd",optionsData.Notifications["offerGeneratePasswd"]);LP.lpprefsSetBoolPref("offerGeneratePasswd",optionsData.Notifications["offerGeneratePasswd"],false);
  34. LP.lpprefsSetBoolPref("showFormFillNotifications",optionsData.Notifications["showFormFillNotifications"]);LP.lpprefsSetBoolPref("showSaveSiteNotifications",optionsData.Notifications["showSaveSiteNotifications"]);LP.lpprefsSetBoolPref("showFormFillNotifications",optionsData.Notifications["showFormFillNotifications"],false);
  35. LP.lpprefsSetBoolPref("showSaveSiteNotifications",optionsData.Notifications["showSaveSiteNotifications"],false);LP.lpprefsSetBoolPref("notificationsBottom",optionsData.Notifications["notificationsBottom"]);LP.lpprefsSetBoolPref("notificationsBottom",optionsData.Notifications["notificationsBottom"],false);
  36. LP.lpprefsSetBoolPref("notificationsAfterClick",optionsData.Notifications["notificationsAfterClick"]);var J=false;if(LP.lpprefsHasUserValue("generateHkKeyCode",false)&&LP.lpprefsGetIntPref("generateHkKeyCode",false)!=optionsData.HotKeys["generateHkKeyCode"]){J=true}LP.lpprefsSetIntPref("generateHkKeyCode",optionsData.HotKeys["generateHkKeyCode"],false);
  37. if(LP.lpprefsHasUserValue("generateHkMods",false)&&LP.lpprefsGetCharPref("generateHkMods",false)!=optionsData.HotKeys["generateHkMods"]){J=true}LP.lpprefsSetCharPref("generateHkMods",optionsData.HotKeys["generateHkMods"],false);if(LP.lpprefsHasUserValue("recheckHkKeyCode",false)&&LP.lpprefsGetIntPref("recheckHkKeyCode",false)!=optionsData.HotKeys["recheckHkKeyCode"]){J=true
  38. }LP.lpprefsSetIntPref("recheckHkKeyCode",optionsData.HotKeys["recheckHkKeyCode"],false);if(LP.lpprefsHasUserValue("recheckHkMods",false)&&LP.lpprefsGetCharPref("recheckHkMods",false)!=optionsData.HotKeys["recheckHkMods"]){J=true}LP.lpprefsSetCharPref("recheckHkMods",optionsData.HotKeys["recheckHkMods"],false);
  39. if(LP.lpprefsHasUserValue("searchHkKeyCode",false)&&LP.lpprefsGetIntPref("searchHkKeyCode",false)!=optionsData.HotKeys["searchHkKeyCode"]){J=true}LP.lpprefsSetIntPref("searchHkKeyCode",optionsData.HotKeys["searchHkKeyCode"],false);if(LP.lpprefsHasUserValue("searchHkMods",false)&&LP.lpprefsGetCharPref("searchHkMods",false)!=optionsData.HotKeys["searchHkMods"]){J=true
  40. }LP.lpprefsSetCharPref("searchHkMods",optionsData.HotKeys["searchHkMods"],false);if(LP.lpprefsHasUserValue("nextHkKeyCode",false)&&LP.lpprefsGetIntPref("nextHkKeyCode",false)!=optionsData.HotKeys["nextHkKeyCode"]){J=true}LP.lpprefsSetIntPref("nextHkKeyCode",optionsData.HotKeys["nextHkKeyCode"],false);
  41. if(LP.lpprefsHasUserValue("nextHkMods",false)&&LP.lpprefsGetCharPref("nextHkMods",false)!=optionsData.HotKeys["nextHkMods"]){J=true}LP.lpprefsSetCharPref("nextHkMods",optionsData.HotKeys["nextHkMods"],false);if(LP.lpprefsHasUserValue("prevHkKeyCode",false)&&LP.lpprefsGetIntPref("prevHkKeyCode",false)!=optionsData.HotKeys["prevHkKeyCode"]){J=true
  42. }LP.lpprefsSetIntPref("prevHkKeyCode",optionsData.HotKeys["prevHkKeyCode"],false);if(LP.lpprefsHasUserValue("prevHkMods",false)&&LP.lpprefsGetCharPref("prevHkMods",false)!=optionsData.HotKeys["prevHkMods"]){J=true}LP.lpprefsSetCharPref("prevHkMods",optionsData.HotKeys["prevHkMods"],false);if(!LP.lpprefsHasUserValue("submitHkKeyCode",false)||(LP.lpprefsHasUserValue("submitHkKeyCode",false)&&LP.lpprefsGetIntPref("submitHkKeyCode",false)!=optionsData.HotKeys["submitHkKeyCode"])){J=true
  43. }LP.lpprefsSetIntPref("submitHkKeyCode",optionsData.HotKeys["submitHkKeyCode"],false);if(LP.lpprefsHasUserValue("submitHkMods",false)&&LP.lpprefsGetCharPref("submitHkMods",false)!=optionsData.HotKeys["submitHkMods"]){J=true}LP.lpprefsSetCharPref("submitHkMods",optionsData.HotKeys["submitHkMods"],false);
  44. if(LP.lpprefsHasUserValue("homeHkKeyCode",false)&&LP.lpprefsGetIntPref("homeHkKeyCode",false)!=optionsData.HotKeys["homeHkKeyCode"]){J=true}LP.lpprefsSetIntPref("homeHkKeyCode",optionsData.HotKeys["homeHkKeyCode"],false);if(LP.lpprefsHasUserValue("homeHkMods",false)&&LP.lpprefsGetCharPref("homeHkMods",false)!=optionsData.HotKeys["homeHkMods"]){J=true
  45. }LP.lpprefsSetCharPref("homeHkMods",optionsData.HotKeys["homeHkMods"],false);if(!LP.lpprefsHasUserValue("saveallHkKeyCode",false)||(LP.lpprefsHasUserValue("saveallHkKeyCode",false)&&LP.lpprefsGetIntPref("saveallHkKeyCode",false)!=optionsData.HotKeys["saveallHkKeyCode"])){J=true}LP.lpprefsSetIntPref("saveallHkKeyCode",optionsData.HotKeys["saveallHkKeyCode"],false);
  46. if(LP.lpprefsHasUserValue("saveallHkMods",false)&&LP.lpprefsGetCharPref("saveallHkMods",false)!=optionsData.HotKeys["saveallHkMods"]){J=true}LP.lpprefsSetCharPref("saveallHkMods",optionsData.HotKeys["saveallHkMods"],false);if(!LP.lpprefsHasUserValue("logoffHkKeyCode",false)||(LP.lpprefsHasUserValue("logoffHkKeyCode",false)&&LP.lpprefsGetIntPref("logoffHkKeyCode",false)!=optionsData.HotKeys["logoffHkKeyCode"])){J=true
  47. }LP.lpprefsSetIntPref("logoffHkKeyCode",optionsData.HotKeys["logoffHkKeyCode"],false);if(LP.lpprefsHasUserValue("logoffHkMods",false)&&LP.lpprefsGetCharPref("logoffHkMods",false)!=optionsData.HotKeys["logoffHkMods"]){J=true}LP.lpprefsSetCharPref("logoffHkMods",optionsData.HotKeys["logoffHkMods"],false);
  48. if(J){LP.lpalert_ex(LP.lpgs("MustRestartFirefoxHotkeys"),window)}LP.lpprefsSetBoolPref("autoauto",optionsData.Advanced["autoauto"]);LP.lpprefsSetIntPref("autoautoVal",optionsData.Advanced["autoautoVal"]);LP.lpprefsSetBoolPref("warninsecureforms",optionsData.Advanced["warninsecureforms"]);LP.lpprefsSetBoolPref("dontfillautocompleteoff",optionsData.Advanced["dontfillautocompleteoff"]);
  49. LP.lpprefsSetBoolPref("pollServer",optionsData.Advanced["pollServer"]);LP.lpprefsSetIntPref("pollServerVal",optionsData.Advanced["pollServerVal"]);LP.lpprefsSetBoolPref("clearClipboard",optionsData.Advanced["clearClipboard"]);LP.lpprefsSetIntPref("clearClipboardSecsVal",optionsData.Advanced["clearClipboardSecsVal"]);
  50. LP.lpprefsSetBoolPref("openloginstart",optionsData.Advanced["openloginstart"]);LP.lpprefsSetBoolPref("openloginstart",optionsData.Advanced["openloginstart"],false);LP.lpprefsSetBoolPref("capturenewformfill",optionsData.Advanced["capturenewformfill"]);LP.lpprefsSetBoolPref("StoreLostPWOTP",optionsData.Advanced["StoreLostPWOTP"]);
  51. LP.lpprefsSetCharPref("language",optionsData.Advanced["language"],false);if(optionsData.General["logOffWhenCloseBrowser"]||optionsData.General["idleLogoff"]){if((LP.lpprefsHasUserValue("rememberPassword",false)&&LP.lpprefsGetBoolPref("rememberPassword",false))||LP.have_loginpw(LP.getUsername())){if(LP.lpConfirmYesNo(LP.lpgs("You currently have LastPass set to remember your master password.  Doing so essentially makes the automatically logoff options you've chosen useless.  Would you like LastPass to stop remembering your master password?"),window)){LP.lpprefsSetBoolPref("rememberPassword",false,false);
  52. LP.delete_loginpw(LP.getUsername())}}}LP.lpprefsSetIntPref("Icon",optionsData.Icons["choice"],false);LP.flush_prefs();LP.SetupUserPreferences();LP.lpSetupIdleTimer();LP.lp_handle_buttons_all("refresh");LP.lpDisplayAccounts_all();return true}function readDataFromPage(){var A=document.getElementById("lastpass-iframe");
  53. var D=A.getAttribute("src");var B=A.contentDocument;if(D.indexOf("feedback")!=-1){optionsData.Feedback=new Array();optionsData.Feedback["subject"]=B.getElementById("subject").value;optionsData.Feedback["description"]=B.getElementById("description").value;optionsData.Feedback["site"]=B.getElementById("site").value;
  54. optionsData.Feedback["email"]=B.getElementById("email").value}else{if(D.indexOf("general")!=-1){optionsData.General=new Array();optionsData.General["disableffpw"]=B.getElementById("disableffpw").checked;optionsData.General["pageOpenTab"]=B.getElementById("pageopen").selectedIndex<=1;optionsData.General["pageOpenSameTab"]=B.getElementById("pageopen").selectedIndex==0;
  55. optionsData.General["highlightFields"]=B.getElementById("highlightFields").checked;optionsData.General["showAcctsInGroups"]=B.getElementById("showAcctsInGroups").checked;optionsData.General["showAcctsInSidebar"]=B.getElementById("showAcctsInSidebar").checked;optionsData.General["hidecontextmenu"]=B.getElementById("hidecontextmenu").checked;
  56. optionsData.General["logOffWhenCloseBrowser"]=B.getElementById("logOffWhenCloseBrowser").checked;optionsData.General["logOffWhenCloseBrowserVal"]=B.getElementById("logOffWhenCloseBrowserVal").value;optionsData.General["idleLogoff"]=B.getElementById("idleLogoff").checked;optionsData.General["idleLogoffVal"]=B.getElementById("idleLogoffVal").value;
  57. optionsData.General["useCompact"]=B.getElementById("useCompact").checked;optionsData.General["automaticallyFill"]=B.getElementById("automaticallyFill").checked;optionsData.General["showHomepageAfterLogin"]=B.getElementById("showHomepageAfterLogin").checked}else{if(D.indexOf("notifications")!=-1){optionsData.Notifications["showNotifications"]=B.getElementById("showNotifications").checked;
  58. optionsData.Notifications["showLoginNotifications"]=B.getElementById("showLoginNotifications").checked;optionsData.Notifications["showFormFillNotifications"]=B.getElementById("showFormFillNotifications").checked;optionsData.Notifications["showSaveSiteNotifications"]=B.getElementById("showSaveSiteNotifications").checked;
  59. optionsData.Notifications["offerGeneratePasswd"]=B.getElementById("offerGeneratePasswd").checked;optionsData.Notifications["notificationsBottom"]=B.getElementById("notificationsBottom").checked;optionsData.Notifications["notificationsAfterClick"]=B.getElementById("notificationsAfterClick").checked}else{if(D.indexOf("hotkey")!=-1){}else{if(D.indexOf("advanced")!=-1){optionsData.Advanced["autoauto"]=B.getElementById("autoauto").checked;
  60. optionsData.Advanced["autoautoVal"]=B.getElementById("autoautoVal").value;optionsData.Advanced["warninsecureforms"]=B.getElementById("warninsecureforms").checked;optionsData.Advanced["dontfillautocompleteoff"]=B.getElementById("dontfillautocompleteoff").checked;optionsData.Advanced["pollServer"]=B.getElementById("pollServer").checked;
  61. optionsData.Advanced["pollServerVal"]=B.getElementById("pollServerVal").value;optionsData.Advanced["clearClipboard"]=B.getElementById("clearClipboard").checked;optionsData.Advanced["clearClipboardSecsVal"]=B.getElementById("clearClipboardSecsVal").value;optionsData.Advanced["openloginstart"]=B.getElementById("openloginstart").checked;
  62. optionsData.Advanced["capturenewformfill"]=B.getElementById("capturenewformfill").checked;optionsData.Advanced["StoreLostPWOTP"]=B.getElementById("storeLostPWOTP").checked;if(optionsData.Advanced["StoreLostPWOTP"]==false){LP.DeleteOTP()}var C=B.getElementById("lplanguage").value;bMustRestart=(C!=optionsData.Advanced["language"]);
  63. optionsData.Advanced["language"]=C}else{if(D.indexOf("icons")!=-1){optionsData.Icons["choice"]=B.getElementById("iconchoice").selectedIndex}}}}}}}function writeDataToPage(){var I=document.getElementById("lastpass-iframe");var A=I.getAttribute("src");var J=I.contentDocument;if(A.indexOf("general")!=-1){var B=Components.classes["@mozilla.org/widget/idleservice;1"];
  64. if(!B){J.getElementById("idleLogoffBox").style.display="none"}else{var F=B.getService(Components.interfaces.nsIIdleService);if(!F){J.getElementById("idleLogoffBox").style.display="none"}}try{if(window.navigator.userAgent.indexOf("SeaMonkey")!=-1){J.getElementById("showAcctsInSidebar").style.display="none"
  65. }}catch(G){}J.getElementById("disableffpw").checked=optionsData.General["disableffpw"];if(optionsData.General["pageOpenTab"]){J.getElementById("pageopen").selectedIndex=optionsData.General["pageOpenSameTab"]?0:1}else{J.getElementById("pageopen").selectedIndex=2}J.getElementById("highlightFields").checked=optionsData.General["highlightFields"];
  66. J.getElementById("showAcctsInGroups").checked=optionsData.General["showAcctsInGroups"];J.getElementById("showAcctsInSidebar").checked=optionsData.General["showAcctsInSidebar"];J.getElementById("hidecontextmenu").checked=optionsData.General["hidecontextmenu"];J.getElementById("logOffWhenCloseBrowser").checked=optionsData.General["logOffWhenCloseBrowser"];
  67. J.getElementById("logOffWhenCloseBrowserVal").value=optionsData.General["logOffWhenCloseBrowserVal"];J.getElementById("idleLogoff").checked=optionsData.General["idleLogoff"];J.getElementById("idleLogoffVal").value=optionsData.General["idleLogoffVal"];J.getElementById("useCompact").checked=optionsData.General["useCompact"];
  68. J.getElementById("automaticallyFill").checked=optionsData.General["automaticallyFill"];J.getElementById("showHomepageAfterLogin").checked=optionsData.General["showHomepageAfterLogin"]}else{if(A.indexOf("notifications")!=-1){J.getElementById("showNotifications").checked=optionsData.Notifications["showNotifications"];
  69. J.getElementById("showLoginNotifications").checked=optionsData.Notifications["showLoginNotifications"];J.getElementById("showFormFillNotifications").checked=optionsData.Notifications["showFormFillNotifications"];J.getElementById("showSaveSiteNotifications").checked=optionsData.Notifications["showSaveSiteNotifications"];
  70. J.getElementById("offerGeneratePasswd").checked=optionsData.Notifications["offerGeneratePasswd"];J.getElementById("notificationsBottom").checked=optionsData.Notifications["notificationsBottom"];J.getElementById("notificationsAfterClick").checked=optionsData.Notifications["notificationsAfterClick"]}else{if(A.indexOf("feedback")!=-1){var K=typeof(LP.lpgetcurrenturl)=="function"?LP.lpgetcurrenturl():"";
  71. J.getElementById("site").value=K;J.getElementById("email").value=LP.getUsername();if(typeof(optionsData.Feedback)!="undefined"){J.getElementById("subject").value=optionsData.Feedback["subject"];J.getElementById("description").value=optionsData.Feedback["description"]}}else{if(A.indexOf("hotkey")!=-1){writeHotKeyValue("generateHk",J);
  72. writeHotKeyValue("recheckHk",J);writeHotKeyValue("searchHk",J);writeHotKeyValue("nextHk",J);writeHotKeyValue("prevHk",J);writeHotKeyValue("submitHk",J);writeHotKeyValue("homeHk",J);writeHotKeyValue("saveallHk",J);writeHotKeyValue("logoffHk",J)}else{if(A.indexOf("advanced")!=-1){var B=Components.classes["@mozilla.org/widget/idleservice;1"];
  73. if(!B){J.getElementById("pollServerBox").style.display="none"}else{var F=B.getService(Components.interfaces.nsIIdleService);if(!F){J.getElementById("pollServerBox").style.display="none"}}J.getElementById("autoauto").checked=optionsData.Advanced["autoauto"];J.getElementById("autoautoVal").value=optionsData.Advanced["autoautoVal"];
  74. J.getElementById("warninsecureforms").checked=optionsData.Advanced["warninsecureforms"];J.getElementById("dontfillautocompleteoff").checked=optionsData.Advanced["dontfillautocompleteoff"];J.getElementById("pollServer").checked=optionsData.Advanced["pollServer"];J.getElementById("pollServerVal").value=optionsData.Advanced["pollServerVal"];
  75. J.getElementById("clearClipboard").checked=optionsData.Advanced["clearClipboard"];J.getElementById("clearClipboardSecsVal").value=optionsData.Advanced["clearClipboardSecsVal"];J.getElementById("openloginstart").checked=optionsData.Advanced["openloginstart"];J.getElementById("capturenewformfill").checked=optionsData.Advanced["capturenewformfill"];
  76. J.getElementById("storeLostPWOTP").checked=optionsData.Advanced["StoreLostPWOTP"];var C=J.getElementById("lplanguagepopup");for(var E in LP.LANGS){var H=J.createElement("menuitem");H.setAttribute("label",LP.LANGS[E][0]);H.setAttribute("value",LP.LANGS[E][1]);C.appendChild(H);if(LP.LANGS[E][1]==optionsData.Advanced["language"]){var D=J.getElementById("lplanguage");
  77. D.selectedItem=H}}}else{if(A.indexOf("icons")!=-1){J.getElementById("iconchoice").selectedIndex=optionsData.Icons["choice"]}}}}}}}function accept_prefs(){var B=document.getElementById("lastpass-iframe");var C=B.contentDocument;readDataFromPage();if(!writeAllPrefData()){return false}if(bMustRestart){LP.alert(LP.lpgs("MustRestart"),window)
  78. }var A=submitFeedback();if(A){LP.last_dialog_close=new Date().getTime()}return A}function submitFeedback(){if(document.getElementById("lastpass-options-list").selectedItem!=document.getElementById("FeedbackPage")){return true}if(optionsData.Feedback!=null){if(optionsData.Feedback["description"]!=null&&optionsData.Feedback["description"]!=""&&optionsData.Feedback["description"].indexOf(LP.lpgs("FeedbackDescIntro"))!=0){if(!LP.lpisp()){if(LP.lpConfirmYesNo(LP.lpgs("premiumnag"),window)){LP.lpbaseopen("premium.php")
  79. }}LP.lpfeedback(optionsData.Feedback["subject"],optionsData.Feedback["description"],optionsData.Feedback["site"],optionsData.Feedback["email"]);return true}}if(document.getElementById("lastpass-options-list").selectedItem==document.getElementById("FeedbackPage")){LP.alert(LP.lpgs("You must enter a description."),window);
  80. return false}else{return true}}function cancel_prefs(){optionsData=new Array();LP.last_dialog_close=new Date().getTime();return true}function changePage(B){var A=document.getElementById("lastpass-options-list");if(A.selectedItem==null){return}if(!B){readDataFromPage()}document.getElementById("lastpass-iframe").setAttribute("src",A.selectedItem.value);
  81. if(A.selectedItem==document.getElementById("FeedbackPage")){document.documentElement.getButton("accept").setAttribute("label",LP.lpgs("Send"))}else{document.documentElement.getButton("accept").setAttribute("label",LP.lpgs("OK"))}}function fix_fields(){if(document.getElementById("logOffWhenCloseBrowser")){document.getElementById("logOffWhenCloseBrowserVal").disabled=document.getElementById("logOffWhenCloseBrowser").checked?false:true
  82. }if(document.getElementById("idleLogoff")){document.getElementById("idleLogoffVal").disabled=document.getElementById("idleLogoff").checked?false:true}if(document.getElementById("autoauto")){document.getElementById("autoautoVal").disabled=document.getElementById("autoauto").checked?false:true}if(document.getElementById("pollServer")){document.getElementById("pollServerVal").disabled=document.getElementById("pollServer").checked?false:true
  83. }if(document.getElementById("clearClipboard")){document.getElementById("clearClipboardSecsVal").disabled=document.getElementById("clearClipboard").checked?false:true}}function capturehk(D,B,C){var A="";A+=(B.ctrlKey?"control":"");A+=(B.metaKey?(A!=""?" ":"")+"meta":"");A+=(B.altKey?(A!=""?" ":"")+"alt":"");
  84. A+=(B.shiftKey?(A!=""?" ":"")+"shift":"");if(A==""||A=="shift"){A="alt"}if(B.keyCode==8||B.keyCode==127||B.keyCode==46||(LP.lpis_mac&&B.altKey)){optionsData.HotKeys[D+"KeyCode"]=0}else{if(B.keyCode==9||B.keyCode==10||B.keyCode==13||B.charCode==32){return}else{if(B.keyCode!=0){optionsData.HotKeys[D+"KeyCode"]=B.keyCode
  85. }else{optionsData.HotKeys[D+"KeyCode"]=B.charCode}}}optionsData.HotKeys[D+"Mods"]=A;writeHotKeyValue(D,C)}function writeHotKeyValue(D,G){var B=optionsData.HotKeys[D+"KeyCode"];var C=G.getElementById(D);var H="";if(B!=0){var A=optionsData.HotKeys[D+"Mods"];var F=A.split(" ");for(var E in F){if(F[E]=="control"){H+=LP.lpgs("Ctrl")+"+"
  86. }if(F[E]=="meta"){H+=LP.lpgs("Meta")+"+"}if(F[E]=="alt"){H+=LP.lpgs("Alt")+"+"}if(F[E]=="shift"){H+=LP.lpgs("Shift")+"+"}}}if(B!=0){if(B==33){H+=LP.lpgs("PageUp")}else{if(B==34){H+=LP.lpgs("PageDown")}else{if(B==35){H+=LP.lpgs("End")}else{if(B==36){H+=LP.lpgs("Home")}else{if(B==37){H+=LP.lpgs("Left")
  87. }else{if(B==38){H+=LP.lpgs("Up")}else{if(B==39){H+=LP.lpgs("Right")}else{if(B==40){H+=LP.lpgs("Down")}else{H+=String.fromCharCode(B).toUpperCase()}}}}}}}}C.value=H}else{C.value=""}}function load_general(B,A){LP.sr(B,"SecurityCaption","label","Security");LP.sr(B,"disableffpw","label","Disable Insecure Firefox Password Manager");
  88. LP.sr(B,"logOffWhenCloseBrowser","label","Automatically Logoff when Close Browser");LP.sr(B,"idleLogoff","label","IdleLogoff");LP.sr(B,"GeneralCaption","label","General");LP.sr(B,"pageopensametab","label","Open New Pages in the current tab");LP.sr(B,"pageopentab","label","Open New Pages in Tabs");LP.sr(B,"pageopenwindow","label","Open New Pages in Windows");
  89. LP.sr(B,"highlightFields","label","Highlight Input boxes");LP.sr(B,"automaticallyFill","label","Automatically Fill Login Information");LP.sr(B,"showHomepageAfterLogin","label","ShowHomepageAfterLogin");LP.sr(B,"AppearanceCaption","label","Appearance");LP.sr(B,"useCompact","label","Use Compact Toolbar");
  90. LP.sr(B,"showAcctsInGroups","label","Show Sites in Groups");LP.sr(B,"showAcctsInSidebar","label","Show Sites in Sidebar");LP.sr(B,"hidecontextmenu","label","Hide Context Menu Options");LP.sr(B,"Appearance","hidden",HIDE_APPEARANCE_BOX?true:false);LP.sr(B,"useCompact","hidden",HIDE_COMPACT_OPTION?true:false);
  91. LP.sr(B,"showAcctsInGroups","hidden",HIDE_GROUPS_OPTION?true:false);LP.sr(B,"showAcctsInSidebar","hidden",HIDE_SIDEBAR_OPTION?true:false);LP.sr(B,"hidecontextmenu","hidden",HIDE_CONTEXT_OPTION?true:false);LP.sr(B,"showHomepageAfterLogin","hidden",HIDE_SHOWHOMEPAGEAFTERLOGON?true:false);LP.sr(B,"logOffWhenCloseBrowserBox","hidden",HIDE_IDLELOGOFF?true:false);
  92. LP.sr(B,"idleLogoffBox","hidden",HIDE_AUTOLOGOFFCLOSE?true:false);parent.writeDataToPage();fix_fields()}function load_notifications(B,A){LP.sr(B,"NotificationsCaption","label","Notifications");LP.sr(B,"showFormFillNotifications","label","Show Form Fill Notifications");LP.sr(B,"showSaveSiteNotifications","label","Show Save Site Notifications");
  93. LP.sr(B,"showNotifications","label","Show Notifications");LP.sr(B,"showLoginNotifications","label","Show Login Notifications");LP.sr(B,"offerGeneratePasswd","label","Offer to Generate Secure Passwords");LP.sr(B,"notificationsBottom","label","Show notifications below browser");LP.sr(B,"notificationsAfterClick","label","Show certain notifications only after click");
  94. parent.writeDataToPage();fix_fields()}function load_feedback(B,A){LP.sr(B,"FeedbackCaption","label","Feedback");LP.sr(B,"SubjectLabel","value","Subject");LP.sr(B,"Option1","label","Option1");LP.sr(B,"Option2","label","Option2");LP.sr(B,"Option3","label","Option3");LP.sr(B,"Option4","label","Option4");
  95. LP.sr(B,"Option5","label","Option5");LP.sr(B,"SiteLabel","value","Site");LP.sr(B,"EmailLabel","value","EmailOptional");LP.sr(B,"DescriptionLabel","value","Description");parent.writeDataToPage()}function load_hotkeys(B,A){LP.sr(B,"HotKeysCaption","label","HotKeys");LP.sr(B,"generateHkLabel","value","Generate Secure Password");
  96. LP.sr(B,"recheckHkLabel","value","Recheck Page");LP.sr(B,"searchHkLabel","value","Site Search");LP.sr(B,"nextHkLabel","value","Fill In Next Login (when multiple)");LP.sr(B,"prevHkLabel","value","Fill In Previous Login (when multiple)");LP.sr(B,"submitHkLabel","value","Submit Form");LP.sr(B,"homeHkLabel","value","Open My LastPass Vault");
  97. LP.sr(B,"saveallHkLabel","value","Save All Entered Data");LP.sr(B,"logoffHkLabel","value","Logoff");LP.sr(B,"searchHkRow","hidden",LP.HIDE_SEARCH_HK?true:false);if(LP.IsVaultHidden()||LP.HIDE_HOME_HK){LP.sr(B,"homeHkRow","hidden",true)}parent.writeDataToPage()}function load_accountsettings(B,A){LP.sr(B,"AccountSettingsCaption","label","Account Settings");
  98. LP.sr(B,"fromtheweb","value","This can only be handled from a webpage");LP.sr(B,"opensettings","value","Click here to launch Account Settings")}function load_advanced(B,A){LP.sr(B,"AdvancedCaption","label","Advanced");LP.sr(B,"autoauto","label","Automatically login to sites if time since last login > (seconds)");
  99. LP.sr(B,"warninsecureforms","label","Warn before filling insecure forms");LP.sr(B,"dontfillautocompleteoff","label","RespectAutoComplete");LP.sr(B,"pollServer","label","Poll server for account changes (mins)");LP.sr(B,"languagetxt","value","Language");LP.sr(B,"clearClipboard","label","Clear Clipboard after use (seconds)");
  100. LP.sr(B,"opentranslate","label","Help Translate");LP.sr(B,"openloginstart","label","Open login dialog when start browser");LP.sr(B,"capturenewformfill","label","Offer to create new Form Fill Profiles Automatically");LP.sr(B,"storeLostPWOTP","label","Save a disabled One Time Password locally for Account Recovery");
  101. LP.sr(B,"pollServerBox","hidden",!LP.lpdopoll);LP.sr(B,"storeLostPWOTPBox","hidden",!LP.lpdolostpwotp);LP.sr(B,"opentranslate","hidden",!LP.lpdohelptranslate);parent.writeDataToPage();fix_fields()}function load_icons(B,A){B.getElementById("ContributeCaption").appendChild(B.createTextNode(LP.lpgs("If you would like to contribute new icons, please contact support@lastpass.com")));
  102. parent.writeDataToPage()}function change_subject(D,B){var A=D.getElementById("subject").value;var E=D.getElementById("description").value;if(E!=""&&E.indexOf(LP.lpgs("FeedbackDescIntro"))!=0){return}var C=LP.lpgs("FeedbackDescIntro")+"\n---------------------------------------------------------\n\n";if(A==LP.lpgs("Option3")){D.getElementById("description").value=C+LP.lpgs("loginsfailsol")+"\n\n"+LP.lpgs("loginsfailsol2")
  103. }else{if(A==LP.lpgs("Option2")){D.getElementById("description").value=C+LP.lpgs("nologinssol")+"\n\n"+LP.lpgs("nologinssol2")}else{if(A==LP.lpgs("Option4")){D.getElementById("description").value=C+LP.lpgs("multloginssol")+"\n\n"+LP.lpgs("multloginssol2")}else{if(A==LP.lpgs("Option5")){D.getElementById("description").value=C+LP.lpgs("nocapturesol")+"\n\n"+LP.lpgs("nocapturesol2")
  104. }else{if(E.indexOf(LP.lpgs("FeedbackDescIntro"))==0){D.getElementById("description").value=""}}}}}}function focus_description(B,A){var C=B.getElementById("description").value;if(C.indexOf(LP.lpgs("FeedbackDescIntro"))==0){B.getElementById("description").value=""}};
  105.